package com.itheima.chapter07.exception;

public class throw1 {
    public static void main(String[] args) {
        int[] arr =null;
        printArr(arr);
    }
    private static void printArr(int[] arr){
        if (arr==null){
            throw new NullPointerException();
        }else {
            for (int i = 0; i < arr.length; i++) {
                System.out.println(arr[i]);
            }
        }
    }
}
